package com.kgc.fk.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.remote.BuyPayApi;
import com.kgc.fk.service.BuyPayService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class BuyPayController implements BuyPayApi {

    private Logger logger = LoggerFactory.getLogger(BuyPayController.class);

    @Resource
    private BuyPayService buyPayService;

    @Override
    public ResponseMsg getBuyPayPage(Map<String, Object> params) {
        logger.info("getBuyPayPage start params:{}", params);
        ResponseMsg responseMsg = buyPayService.getBuyPayPage(params);
        logger.info("getBuyPayPage end params:{} , response{}", params ,responseMsg );
        return responseMsg;
    }

    @Override
    public ResponseMsg updateBuyPay(Map<String, Object> params) {
        logger.info("updateBuyPay start params:{}", params);
        ResponseMsg responseMsg = buyPayService.updateBuyPay(params);
        logger.info("updateBuyPay end params:{} , response{}", params ,responseMsg );
        return responseMsg;
    }

    @Override
    public ResponseMsg addBuyPay(Map<String, Object> params) {
        logger.info("addBuyPay start params:{}", params);
        ResponseMsg responseMsg = buyPayService.addBuyPay(params);
        logger.info("addBuyPay end params:{} , response{}", params ,responseMsg );
        return responseMsg;
    }

    @Override
    public ResponseMsg getBuyPay(Map<String, Object> params) {
        logger.info("getBuyPay start params:{}", params);
        ResponseMsg responseMsg = buyPayService.getBuyPayByCode(params);
        logger.info("getBuyPay end params:{} , response{}", params ,responseMsg );
        return responseMsg;
    }

    @Override
    public ResponseMsg modiBuyPay(Map<String, Object> params) {
        logger.info("modiBuyPay start params:{}", params);
        ResponseMsg responseMsg = buyPayService.modifyBuyPay(params);
        logger.info("modiBuyPay end params:{} , response{}", params ,responseMsg );
        return responseMsg;
    }
}
